<template>
  <div>
    <template v-if="menu.children && menu.children.length > 0">
        <el-submenu :index="menu.path" :key="menu.path">
            <template slot="title">
                <i class="el-icon-location"></i>
                <span>{{ menu.title }}</span>
            </template>   
            <nav-menu-item v-for="item in menu.children" :menu="item" :key="item.path"></nav-menu-item>            
        </el-submenu>
    </template>
    <template v-else>
      <el-menu-item :index="menu.path" :key="menu.path" style="min-width: none">
        <i class="el-icon-menu"></i>
        <span slot="title">{{ menu.title }}</span>
      </el-menu-item>
    </template>
  </div>
</template>

<script>
export default {
    name:"NavMenuItem",
  props: ["menu"],
};
</script>